import { request } from '@/utils/http';

const api = {
	DEVICE_INFO: '/device/getInfo',
	ACTIVE_DEVICE: '/device/activate',
	DEVICE_INIT_STATUS: '/device/initStatus',
	DEVICE_LIGHT_BRIGHTNESS: '/device/lightBrightness/',
}

/**
 * 获取设备信息
 * @param params
 */
export const deviceInfo = () => request.get(api.DEVICE_INFO);

/**
 * 激活设备
 * @param params
 */
export const activeDevice = (params) => request.put(api.ACTIVE_DEVICE, params);

/**
 * 获取设备初始化状态
 * @param params
 */
export const deviceInitStatus = () => request.put(api.DEVICE_INIT_STATUS, {});

/**
 * 设置灯亮度
 * @param params
 */
export const deviceLightBrightness = (params) => request.put(api.DEVICE_LIGHT_BRIGHTNESS + params, {});